package experiment3;

import java.util.Scanner;

public class No_6 {
    public static void main(String []args)
    {
        System.out.println("请输入10个数：");
        Scanner input=new Scanner(System.in);
        double[] numbers=new double[10];
        for (int i=0;i<10;i++)
        {
            numbers[i]=input.nextDouble();
        }


        int i,j;
        for(i=0;i<numbers.length-1;i++)
        {
            for(j=0;j<numbers.length-1-i;j++)
            {
                if(numbers[j]>numbers[j+1])
                {
                    double temp=numbers[j];
                    numbers[j]=numbers[j+1];
                    numbers[j+1]=temp;
                }
            }
        }

        System.out.println("从小到大排序后的结果是:");
        for(i=0;i<numbers.length;i++)
            System.out.print(numbers[i]+" ");

    }
}
